<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CommonPageList.ascx.cs" Inherits="admin_webparts_Plug_ins_CommonPage_CommonPageList" %>
<%@ Register Src="CommonPageTreeView.ascx" TagName="CommonPageTreeView" TagPrefix="uc1" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.CommonPage" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<style type="text/css">
#divTreeView {
    float: left;
    /*margin-top: 53px; */
    border: solid 1px #89D;
}
#main {
    position: relative;
}
</style>
<div id="divHeaderTip" style="margin-left: 0px; margin-bottom: 10px;">
    <div class="tip">
	    <h1 style="left: 0px; position: relative;"><%=LanguageUtility.GetLanguageText("COMMON_CONTENT_MANAGEMENT", Session)%></h1>
        <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
    </div>
</div>
<uc1:CommonPageTreeView ID="CommonPageTreeView1" runat="server" />
<script type="text/javascript">
YAHOO.util.Event.onDOMReady(function() {
    oTreePage.nodeClickEvent = function(data) {
        var oDom = YAHOO.util.Dom;

        var oFrame = oDom.get('frameData');
        oFrame.src = 'CommonPageContent.aspx?action=view&g=' + data.groupID + '&mnuid=' + data.id + '&time=' + (new Date()).getTime();
    }
});

function onFrameUnload() {
    var frm = oDom.get('frameData');
    frm.height = 1;
}

function onFrameChanged() {
    var oDom = YAHOO.util.Dom;
    
    var frm = oDom.get('frameData');
    
    if (frm) {
        //frm.height = '1px';
        
        if(typeof window.onresize == 'function') {
            window.onresize();
        }
        
        if (frm.contentDocument && frm.contentDocument.body.offsetHeight) {
            // W3C DOM (and Mozilla) syntax
            frm.height = '' + (parseInt(frm.contentDocument.body.offsetHeight, 10)) + 'px';
        } else if (frm.Document && frm.Document.body.scrollHeight) {
            // IE DOM syntax
            frm.height = '' + (parseInt(frm.Document.body.scrollHeight, 10) - 5) + 'px';
        }
    }
}
YAHOO.util.Event.onDOMReady(onFrameChanged);
</script>
<div class="olc olc-in">
    <a class="in" href="#" onclick="togg(this); return false;"></a>
</div>
<div style="border: solid 1px #89D; margin-left: 265px; ">
    <div id="commonPageContainer" style="padding: 0px 5px;">
        <iframe id="frameData" onunload="onFrameUnload();" onload="javascript: onFrameChanged();" style="width: 100%; position: relative; top: -5px;" frameborder="0" marginheight="0px" enableviewstate="true" height="400px" scrolling="no" src=""></iframe>
    </div>
    <div style=" clear: both;"></div>
</div>
<style type="text/css">
.olc {
    position: relative;
    float: left;
    z-index: 50;
    width: 12px;
    height: 15px;
    overflow: hidden;
    background-color: #fff;
    border: solid 0px #89D;
}
.olc a {
    display: block;
    width: 12px;
    height: 15px;
    background-color: #fff;
    background-image: url(resources/images/sprite.png);
    background-repeat: no-repeat;
    background-position:100px 100px;
}
.olc a.out {
    background-position:-6px -500px;
}
.olc a.in {
    background-position:-6px -450px;
}
</style>
<script type="text/javascript">
function togg(o){
    var oTogg = o;
    var oTree = document.getElementById('divTreeView');
    var oContent = document.getElementById('commonPageContainer');
    
    if (oTogg.className === 'in') {
        oTogg.className = 'out';
        //oTree.style.display = 'none';
        oTree.style.width = '1px';
        oTree.style.overflow = 'hidden';
        oContent.parentNode.style.marginLeft = '16px';
    } else {
        oTogg.className = 'in';
        //oTree.style.display = '';
        oTree.style.width = '250px';
        oTree.style.overflow = 'scroll';
        oContent.parentNode.style.marginLeft = '265px';
    }
}
</script>
